﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ApprovalFlow.aspx.cs" Inherits="AuxiliaryManagement_BasicDataManagement_ApprovFlow_ApprovalFlow" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <link href="../../Includes/Guide.css" type="text/css" rel="stylesheet" />
    <link href="../../Includes/index.css" type="text/css" rel="stylesheet" />
    <link href="../../Includes/MasterPage.css" type="text/css" rel="stylesheet" />
    <link href="../../Includes/xtree.css" type="text/css" rel="stylesheet" />
    <link href="../../css/MyCss.css" type="text/css" rel="stylesheet" />
    <link href="../../css/Style.css" rel="stylesheet" type="text/css" />
    <title>审批流程</title>
</head>
<script src="../../js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script src="../../Includes/jquery-1.4.1.js" type="text/javascript"></script>
<script src="../../Includes/MyJScript.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">

    //显示repeater行数
    function display(space) {
        var lineNum = document.getElementById("HiddenField1").value;

        lineNum = space * 1 + lineNum * 1;

        var items = document.getElementsByTagName("div");
        var num = 0;
        for (var i = 0; i < items.length; i++) {
            if (items[i].title == "detail") {
                if (num < lineNum) {
                    items[i].style.display = "block";
                }
                else {
                    items[i].style.display = "none";
                }
                num++;
            }
        }
        document.getElementById("HiddenField1").value = lineNum;
    }
    //错误提示
    function chkLogin() {
        alert("错误：未检测到登录信息，请进行登录！");
        window.navigate("../Login.aspx");
    }
    //关闭当前窗口
    function winCancel() {
        parent.PE_FrameTab.CloseCurrentTab();
    }

    //选择岗位
    function secRole(obj) {


        var roleName = window.showModalDialog("../../FormSec/RoleUserSec.aspx", null, "dialogWidth=800px;dialogHeight=600px;status=no;help=no;scrollbars=no");
        if (typeof (roleName) == "undefined") {
            return;
        }
        var divs = roleName.split("~");
        //alert(divs);
        var roleid = divs[0];
        var rolename = divs[1];
        var userid = divs[2];
        var username = divs[3];
        //obj.parentElement.parentElement.cells[9].childNodes[0].value = no;
        //obj.parentElement.parentElement.cells[10].childNodes[0].value = name;
        obj.value = rolename;
        
        obj.parentElement.parentElement.cells[7].childNodes[0].value = roleid;

    }
    //当前上级岗位复选框选择
    function onchkisSuPost(obj) {

        //obj.parentElement.parentElement.parentElement.cells[7].childNodes[0].value
        if (obj.checked) {
            obj.parentNode.parentNode.parentNode.cells[2].childNodes[0].value = "";
            obj.parentNode.parentNode.parentNode.cells[7].childNodes[0].value = "";
            obj.parentNode.parentNode.parentNode.cells[2].childNodes[0].disabled = true;
        } else {
        obj.parentNode.parentNode.parentNode.cells[2].childNodes[0].disabled = false;
        }

    }
    //条件编辑
    function secConditon(obj) { 
        
    }
</script>
<body onload="display(0)">

    <form id="form1" runat="server">
    <div class="inputbuttondiv">
<asp:Button ID="btnSave" runat="server" Text="保存"  CssClass="inputbutton" 
            onclick="btnSave_Click"  />
<asp:Button ID="btnUpd" runat="server" Text="修改"  CssClass="inputbutton" onclick="btnUpd_Click" 
            />
                    <asp:Button ID="btnCancel" runat="server" Text="取消" CssClass="inputbutton"  OnClientClick="winCancel()"/>
</div>
    <div>
        <table class="item" style="margin:0px 0px 0px 0px; width:1000px">
            <tr>
                <td class="tdbg" style=" width:125px">系统编码:</td>
                <td>
                    <asp:TextBox ID="txtsysno" runat="server" CssClass="inputtext"></asp:TextBox>
                </td>
                <td class="tdbg" style=" width:125px">流程名称:</td>
                <td>
                    <asp:TextBox ID="txtapprovName" runat="server" CssClass="inputtext"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="tdbg" style=" width:125px">业务对象:</td>
                <td>
                    <asp:DropDownList ID="ddlopNo" runat="server" Width="130px" AppendDataBoundItems="true">
                        <asp:ListItem Value="-1">-选择-</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td class="tdbg" style=" width:125px">定义人:</td>
                <td>
                    <asp:TextBox ID="txtfillPsn" runat="server" CssClass="inputtext"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="tdbg" style=" width:125px">定义日期:</td>
                <td>
                    <asp:TextBox ID="txtfilldate" runat="server" CssClass="Wdate" 
                        onFocus="WdatePicker({isShowClear:false,readOnly:true})" Width="120px"></asp:TextBox>
                </td>
                <td class="tdbg" style=" width:125px">备注:</td>
                <td>
                    <asp:TextBox ID="txtremarks" runat="server" CssClass="inputtext"></asp:TextBox>
                </td>
            </tr>
       <tr>
       <td colspan="4" align="left">
        <asp:Panel ID="Panel1" runat="server" Height="300px" ScrollBars="Both" Width="1000px">
        <table style="width:700px">
            <tr>
                <td align="center" style="width:60px">
                    行号
                </td>
                 <td align="center" style="width:60px">
                    顺序号
                </td>
                <%-- <td align="center" style="width:100px">
                    审批人
                </td>--%>
                 <td align="center" style="width:100px">
                    审批岗位
                </td>
                 <td align="center" style="width:100px">
                     上级岗位</td>
                 <td align="center" style="width:60px; text-align: left;">
                     百分比</td>
                 <td align="center" style="width:200px">
                     备注
                </td>
                <td align="center" style="width:50px">
                    条件
                </td>
            </tr>
        </table>
        
        <asp:Repeater ID="Repeater1" runat="server">
         <ItemTemplate>
                    <div id="h" style="display: block; padding-left: 0px; padding-right: 0px;" runat="server" name="h" title="detail">
                        <table  cellpadding="0px" cellspacing="0px" style=" width: 680px" border="1">
                        <tr>
                        <td><asp:Label  ID="lbllineid" width="60px" runat="server" Text='<%# Eval("lineId") %>'></asp:Label></td>
                        <td>
                            <asp:TextBox ID="txtordNo" width="60px" runat="server" Text='<%# Eval("ordNo") %>'></asp:TextBox></td>
                       <%-- <td>
                            <asp:TextBox ID="txtapprovpsn" width="100px" runat="server" ></asp:TextBox></td>--%>
                        <td>
                            <asp:TextBox ID="txtapprovPost" width="100px" runat="server" Text='<%# Eval("rolename") %>' ondblclick="secRole(this)"></asp:TextBox></td>
                        <td>
                            <asp:CheckBox ID="chkisSuPost" runat="server" Width="100px" Checked='<%#  Convert.ToInt32(Eval("isSuPost"))==1?true:false %>' onclick="onchkisSuPost(this)"/></td>
                         <td>
                            <asp:TextBox ID="txtapprovPercent" style="width:60px" runat="server" Text='<%# Eval("approvPercent")%>'></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txtremarks" style="width:200px" runat="server" Text='<%# Eval("remarks") %>'></asp:TextBox></td>
                        <td>
                            <asp:LinkButton ID="LinkButton1" runat="server" Width="100px" OnClientClick="secConditon(this)">编 辑</asp:LinkButton></td>
                            <td style="width: 0px">
<%--                            <asp:TextBox ID="txtapprovPostNo" width="0" runat="server" BorderWidth="0px" Text='<%# Eval("approvPost") %>'></asp:TextBox>--%>
                            <asp:HiddenField ID="txtapprovPostNo" runat="server" Value='<%# Eval("approvPost") %>' /></td>
                        </tr>
                        </table>
                        </div>
                        </ItemTemplate>
        </asp:Repeater>
        </asp:Panel>
       </td>
       </tr>
       
    </table> </div>
    <asp:HiddenField ID="HiddenField1" runat="server" Value="10" />
    </form>
     
</body>
</html>

